package com.springapp.controller;

import com.springapp.service.IStockTotalService;
import com.springapp.service.impl.PaletteEnStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by nicol_000 on 10/08/14.
 */
@Controller
@RequestMapping("/stockGlobal")
public class ControlStockTotal {
    @Autowired
    private IStockTotalService stockTotalService;

//    @Autowired
//    private ArticleConditionnementService articleConditionnementService;
    private boolean bEstPicking;


    @RequestMapping(value="/all", method = RequestMethod.GET)
    public ModelAndView displayGlobal(){
        bEstPicking = false;
        ModelAndView modelPalettesStock = new ModelAndView("Reappro_StockZoneCasier");

        modelPalettesStock.addObject("lstPalettes", stockTotalService.getLstPaletteEnStockTotal(false));

        return modelPalettesStock;
    }

    @RequestMapping(value="/picking", method = RequestMethod.GET)
    public ModelAndView displayPicking(){
        bEstPicking = true;
        ModelAndView modelPalettesPicking = new ModelAndView("Reappro_StockPicking");

        modelPalettesPicking.addObject("lstPalettePicking", stockTotalService.getLstPaletteEnStockTotal(true));

        return modelPalettesPicking;
    }







}
